<div id="content">
  <div class="row s_page_title">
    <sa-big-breadcrumbs
      [items]="['日志信息管理', '自动重置设备ID日志']"
      icon="fa fa-tag"
      class="col-xs-12 col-sm-7 col-md-7 col-lg-4"
    ></sa-big-breadcrumbs>
  </div>
  <sa-widgets-grid>
    <div class="s_table">
      <div sa-widget [editbutton]="false" color="darken" class="clearfix">
        <header>
          <span class="widget-icon"><i class="fa fa-table"></i></span>
          <h2>自动重置设备ID日志</h2>
        </header>
        <div>
          <div class="widget-body no-padding">
            <div class="page-header clearfix s_table_opreation">
              <div class="left page-header-btn">
                <sa-company-tree-car
                  companyTreeId="companyTree"
                  (companySelected)="companySelected($event)"
                ></sa-company-tree-car>
                <div class="selectDate top_module">
                  <table-select-date (outerTime)="getSelectTableTime($event)"></table-select-date>
                </div>
                <div class="top_module">
                  <span class="module_text">执行步骤</span>
                  <select name="type" id="" class="module_inp" [(ngModel)]="step">
                    <option value="">请选择</option>
                    <option value="1">设备ID重置</option>
                    <option value="2">上传频率设置</option>
                    <option value="3">硬件版本获取</option>
                    <option value="4">系数下发</option>
                    <option value="5">算法版本升级</option>
                  </select>
                </div>

                <div class="top_module">
                  <span class="module_text">步骤状态</span>
                  <select name="type" id="" class="module_inp" [(ngModel)]="status">
                    <option value="">请选择</option>
                    <option value="1">成功</option>
                    <option value="0">失败</option>
                  </select>
                </div>
                <button type="button" class="btn btn-primary" (click)="search_data()">查询</button>
              </div>
              <div class="right top-search">
                <input
                  class="search-input"
                  [(ngModel)]="searchKey"
                  (change)="table_search()"
                  placeholder="公司名称,车牌号码..."
                  type="text"
                />
                <span class="top-search-box">
                  <button class="top-search-btn" (click)="table_search()" type="button">
                    <i class="fa fa-search"></i>
                  </button>
                </span>
              </div>
            </div>
            <div class="table_scroll">
              <table
                class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table"
              >
                <thead>
                  <tr>
                    <th>设备ID</th>
                    <th>车牌号码</th>
                    <th>公司名称</th>
                    <th>任务开始执行时间</th>
                    <th>任务结束执行时间</th>
                    <th>执行步骤</th>
                    <th>步骤执行时间</th>
                    <th>执行步骤具体信息</th>
                    <th>步骤状态</th>
                    <th>重置ID具体信息</th>
                    <th>上传频率具体信息</th>
                    <th>硬件版本设置具体信息</th>
                    <th>算法版本具体信息</th>
                    <th>操作人</th>
                    <th>操作时间</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let row of resultTableData">
                    <td>{{ row.deviceId }}</td>
                    <td>{{ row.carNumber }}</td>
                    <td>{{ row.companyName }}</td>
                    <td>{{ row.startDate }}</td>
                    <td>{{ row.endDate }}</td>
                    <td>
                      {{
                        row.step === 1
                          ? '设备ID重置'
                          : row.step === 2
                          ? '上传频率设置'
                          : row.step === 3
                          ? '硬件版本获取'
                          : row.step === 4
                          ? '系数下发'
                          : row.step === 5
                          ? '算法版本升级'
                          : ''
                      }}
                    </td>
                    <td>{{ row.stepDate }}</td>
                    <td>{{ row.stepMessage }}</td>
                    <td>
                      {{ row.status === 0 ? '失败' : row.status === 1 ? '成功' : '' }}
                    </td>
                    <td>{{ row.resetDeviceMsg }}</td>
                    <td>{{ row.frequencyMsg }}</td>
                    <td>{{ row.hwVersionMsg }}</td>
                    <td>{{ row.binMsg }}</td>
                    <td>{{ row.operator }}</td>
                    <td>{{ row.operatorTime }}</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="table-fix clearfix">
              <paginator
                [totalRecords]="totalCount"
                [rows]="pageSize"
                [currentPage]="curPage - 1"
                (onPageChange)="paginate($event)"
              ></paginator>
              <button type="button" class="btn default refresh_btn" (click)="refresh()">
                <i class="fa fa-refresh"></i>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </sa-widgets-grid>
</div>
